package com.budwk.app.sqfw.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author ZY.Wang
 * @since 2023/11/10
 */
@Getter
@AllArgsConstructor
public enum SupportBusinessTypeEnum {

    SAFETY_CHECK("safety_check", "安全排查"),
    REFUSE_CLASSIFY("refuse_classify", "垃圾分类"),
    RUBBISH_CLASSIFY("RUBBISH_CLASSIFY", "垃圾分类巡查"),
    HOUSE_SURVEY_FORM("house_survey_form", "入户调查"),
    PUBLIC_SECURITY("public_security", "社会治安"),
    MEET_RECORD("meet_record", "会议记录"),
    OLD_CARE_SERVICE("old_care_service", "养老服务站巡查"),
    RED_WHITE_RECORD("red_white_record", "红白事备案"),
//    MEET_ACTIVITY_VISIT_RECORD("MEET_ACTIVITY_VISIT_RECORD", "会议/活动/来访记录"),
    MEETING_ACTIVITY_VISIT_RECORD("MEETING_ACTIVITY_VISIT_RECORD", "会议/活动/来访记录"),
    PROPAGANDA_SCREENING("propaganda_screening", "宣传/排查记录"),
    PROPAGANDA_SCREENING_JINGYANG("propaganda_screening", "宣传/排查记录/金阳街道"),
    OLD_PEOPLE_SEEK("OLD_PEOPLE_SEEK", "特殊老年人探访"),
    ENTERPRENEURAL("entrepreneurial_households", "创业实体入户"),
    FOREST_AND_RIVER_FLOOD_DISASTER("forest_and_river_flood_disaster", "林河汛灾防治"),
    INSPECTION_OF_NON_ACADEMIC_EDUCATIONAL_INSTITUTIONS("inspection_of_non_academic_educational_institutions", "非学制教育机构巡查"),
    ENTERPRISE_WARRANTY_SERVE("enterprise_warranty_serve", "企业包保服务"),
    CHILDREN_VISITATION("children_visitation", "儿童探访记录"),
    CARE_WORKER_VISIT("CARE_WORKER_VISIT", "关爱人员探访"),
    PROPAGANDA_OF_SAFE_CONSTRUCTION("propagandaOfSafeConstruction", "平安建设宣传"),
    ONE_TO_FIVE("one_two_three_four_five", "12345"),
    FLOOD_CONTROL_ASSISTANT("flood_control_assistant", "防汛助手"),
    BUILD_TYPE("building_info_type", "入户楼栋信息采集"),
    HOUSE_TYPE("house_info_type", "入户房屋信息采集"),
    PERSON_TYPE("person_vis_type", "入户人员走访"),
    DIFFICULT_PERSON_VISIT("DIFFICULT_PERSON_VISIT", "困难走访"),
    THREE_GUARANTEE("three_guarantee","门前三包"),
    POVERTY_MONITORING("POVERTY_MONITORING", "脱贫监测"),
    SAFE_CHECK("safety_check", "安全排查整治"),
    BATYUN_SAFE("baiyun_safety_check","白云安全排查"),
    HOUSEHOLD_INFO("household_info", "住户信息"),



    ;

    private final String code;
    private final String name;


    /**
     * 根据code获取name
     *
     * @param code
     * @return
     */
    public static String getNameByCode(String code) {
        for (SupportBusinessTypeEnum o : SupportBusinessTypeEnum.values()) {
            if (o.getCode().equals(code)) {
                return o.getName();
            }
        }
        return null;
    }

    public static SupportBusinessTypeEnum getCodeByName(String name) {
        for (SupportBusinessTypeEnum o : SupportBusinessTypeEnum.values()) {
            if (name.equals(o.getName())) {
                return o;
            }
        }
        return null;
    }
}
